package com.thinqq.web.client.content.painter;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.thinqq.web.client.ThinqQImageBundle;
import com.thinqq.web.client.constants.CSSConstants;
import com.thinqq.web.client.content.InformationTechnology;
import com.thinqq.web.client.content.ProductDevelopment;
import com.thinqq.web.client.content.handler.LinkClickHandler;

public class ProductDevelopmentContentPainter implements IContentPainter {

	@Override
	public void updateConent(HorizontalPanel mainContent,
			VerticalPanel relatedContent) {
		mainContent.clear();
		FlowPanel mainITPanel = new FlowPanel();
		ProductDevelopment pdContent = GWT.create(ProductDevelopment.class);
		ThinqQImageBundle imageBundle = GWT.create(ThinqQImageBundle.class);
		Label title = new Label(pdContent.title());
		title.setStyleName(CSSConstants.CSS_MAIN_CONTENT_TITLE);
		
		mainITPanel.setStyleName(CSSConstants.MAIN_CONTENT_COMMON_STYLE);
		mainITPanel.add(title);
		mainITPanel.add(new Label(pdContent.oneLiner()));
		Image itContentImage = new Image(imageBundle.getProductDevlopmentmage());
		Grid grid = new Grid(1,2);
		grid.setWidget(0,0,itContentImage);
		FlowPanel itContentPanel = new FlowPanel();
		Label servicesListOneliner = new Label(pdContent.itServicesListOneLiner());
		servicesListOneliner.addStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		itContentPanel.add(servicesListOneliner);
		//Project Planning
		Anchor projectPlanLink = new Anchor(pdContent.productPlanningandUsabilityEngg());
		projectPlanLink.addClickHandler(new LinkClickHandler(ContentPainterRegistry.getContentPainter(ContentPainterRegistry.APPLICATION_DEVELOPMENT), mainContent, relatedContent));
		projectPlanLink.addStyleName(CSSConstants.UNORDERED_BULLET);
		itContentPanel.add(projectPlanLink);
		Label projectPlanOneLiner = new Label(pdContent.productPlanningOneLiner());
		projectPlanOneLiner.addStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		itContentPanel.add(projectPlanOneLiner );
		//Product Re-engineering
		Anchor produtDev = new Anchor(pdContent.productDesignDev());
		produtDev.addClickHandler(new LinkClickHandler(ContentPainterRegistry.getContentPainter(ContentPainterRegistry.COMMUNICATION_CONTENT), mainContent, relatedContent));
		produtDev.addStyleName(CSSConstants.UNORDERED_BULLET);
		itContentPanel.add(produtDev );
		Label produtDevOneLiner = new Label(pdContent.productDesignDevOneLiner());
		produtDevOneLiner.addStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		itContentPanel.add(produtDevOneLiner );
		//Product Re-engineering
		Anchor produtRengg = new Anchor(pdContent.productReengg());
		produtRengg.addClickHandler(new LinkClickHandler(ContentPainterRegistry.getContentPainter(ContentPainterRegistry.COMMUNICATION_CONTENT), mainContent, relatedContent));
		produtRengg.addStyleName(CSSConstants.UNORDERED_BULLET);
		itContentPanel.add(produtRengg );
		Label produtRenggOneLiner = new Label(pdContent.productReenggOneLiner());
		produtRenggOneLiner.addStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		itContentPanel.add(produtRenggOneLiner );
		grid.setWidget(0,1,itContentPanel);
		mainITPanel.add(grid);
		mainContent.add(mainITPanel);

	}

}
